<{include file="top_v2.html" }>
</head>
<body>
<div id="wrap" class="pt record-page">
    <div class="header">
        兑换记录
        <a href="javascript:window.history.back();" class="back"></a>
    </div>

    <div class="container">
        <{if count($list)>0}>
        <div class="info">说明: 卡券请到<a href="<{u('Card/cardlist')}>">【我的卡包】</a>中查看</div>
        <ul id="exchangeLogMore">
            <{foreach from = $list item=item}>
            <li>
                <a href="<{u('info/?id='|cat:$item['id'])}>">
                    <div class="hd">
                        <span class="time"><{'Y-m-d H:i'|date:$item.exchangeTime}></span>
                        <span class="state"><{$exchangeStatus[$item.status]}></span>
                    </div>
                    <div class="bd">
                        <div class="img-box" style="background: url(<{$preUploadUrl}><{$item.listPic}>);"></div>
                        <div class="detail">
                            <p><{$item.titleList}></p>
                            <p class="score"> <{if $item.point gt 0 and $item.nowPrice eq 0}>
                                <{$item.point}>积分
                                <{elseif $item.point eq 0 and $item.nowPrice gt 0}>
                                <{$item.nowPrice}>元
                                <{else}>
                                <{$item.point}>积分 +<{$item.nowPrice}>元
                                <{/if}></p>
                            <p class="price">市场参考价: <{$item.originalPrice}>元</p>
                        </div>
                    </div>
                </a>
            </li>
            <{/foreach}>
        </ul>

        <a href="javascript:void(0);" class="loadMore" id="load_more">加载更多</a>
        <{else}>
        <{/if}>

    </div>
</div>


</body>
</html>
<script>


    //拖动加载
    var  flagData  =  true;
    var  flagAjax  =  true;
    var  page      =  2;
    //加载
    function  load_more(postData){

        //$("#load_more").css({'background':'url("<{$preStaticUrl}>Wap/images/load.gif")  center  center  no-repeat;background-size:30px  30px;'});
        $("#load_more").html('正在加载...');
        if(!flagAjax){
            return  false;
        }
        flagAjax  =  false;
        $.post("<{u('exchangeLogMore')}>",postData,function(data){
            flagAjax  =  true;
            if(data.data)  {
                $("#"+postData.pos).append(data.data);
                $("#load_more").html('加载更多');
                page++;
                //$("#load_more").css({'background':'url("<{$preStaticUrl}>Wap/images/load.gif")  center  center  no-repeat;background-size:30px  30px;'});
            } else {
                flagData  =  false;
                $("#load_more").html('没有更多啦');
            }
        },'json');
    }
    var  tmp_scroll  =  0;
    //拖动加载
    function  scroll_load(postData){
        if  (tmp_scroll  ==  $(window).height()  +  $(window).scrollTop())  {
            return;
        }
        tmp_scroll  =  $(window).height()  +  $(window).scrollTop();
        var  jia_scroll  =  $(document).height()  -  ($(window).height()  +  $(window).scrollTop());
        if  (jia_scroll  <  100  &&  flagData)  {
            load_more(postData);
        }
    }
    $(window).scroll(function(){
        scroll_load({p:page,pos:"exchangeLogMore"});
    });

</script>


